package com.tkk.monitoring.analyze.config;


import org.apache.commons.io.IOUtils;

import java.io.IOException;
import java.util.List;

/**
 * Created by Administrator on 2015/7/9.
 */
public class Line extends Config {

    private List<String> lines;
    private int index = -1;

    public Line(String filePath) {
        super(filePath);
        try {
            lines = IOUtils.readLines(getInputStream());
        } catch (IOException e) {
        }
    }

    public List<String> getLines() {
        return lines;
    }

    public String next() {
        if (index > lines.size()) {
            index = -1;
        }
        index++;
        return lines.get(index);
    }
}
